package net.hnedu.search.resource;

import java.util.TimerTask;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class DeleteResIndex
    extends TimerTask {
  private static Log log = LogFactory.getLog(DeleteResIndex.class);

  private int resId;

  /*
   * Contructor with default access, prevent new an instance from outside package
   */
  DeleteResIndex(int resId) {
    this.resId = resId;
  }

  public void run() {
    log.debug("DeletePostIndexTask.run : objectID = " + resId);
    try {
      ResourceIndex.deleteResFromIndex(resId);
    }
    catch (Exception ex) {
      log.error("Error while performing index operation", ex);
    }
  }

}
